<?php
session_start();

if(!isset($_SESSION['id'])){
	header('Location:login.php');
}
$username=$_SESSION['username'];
$connetc=mysql_connect("localhost","root","");
mysql_select_db("shenji",$connetc);
mysql_query("set names utf8");
$sql4="select * from user where username='$username'";

$result4=mysql_query($sql4);
$row4=mysql_num_rows($result4);


if($row4==0){
	echo "<script>alert('用户不存在，请重新登录！');top.location.href='./login.php'</script>";
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery-1.6.3.min.js"></script>
</head>
<style>
.btn1{width:80px;height:35px; background:url(../images/btnbg.png) no-repeat; font-size:14px;font-weight:bold;color:#fff; cursor:pointer;}
</style>
<body>
	<div class="place">
    <span>位置：</span>
    <ul class="placeul">
    <li><a href="#">接口配置</a></li>
	<li><a href="#">机器码文件导入</a></li>	
    </ul>
    </div>
	
    <div class="formtitle"><span>基本信息</span></div>
	<form action="txt_commit.php" method="post" enctype="multipart/form-data">
	<label>授权机器码文件:</label>
	<input type="file" name="file" id="file"/>
	<label>类型</label>
	<select name="typeid" style="width:86px;height:34px;border:1px solid #ccc;">
	<?php $sql="select * from type"; $result=mysql_query($sql); while($row=mysql_fetch_assoc($result)){?>
		<option value="<?php echo $row['typeid'] ?>"><?php echo $row['name'] ?></option>
	<?php } ?>
	</select>
	<br/>
	<input type="submit" name="submit" class="btn1" style="margin-top:10px;" value="txt导入"/>
    </form>
	
	<label>注意:txt内容每行格式为:licesneid,备注(licesneid与备注用英文逗号隔开,每条数据用换行符区分)</label>
	
</body>
</html>
<script>
	 $(document).ready(function(){
	  
	  var username="<?php echo $_SESSION['username']; ?>";
	  if(username==null||username.length==0){		  
		 window.top.location.href="../login.php";
	  }
	  
  })
</script>